package com.cxs.service.impl;

import com.cxs.mapper.PharmacyMapper;
import com.cxs.pojo.Pharmacy;
import com.cxs.service.PharmacyService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import javafx.print.PageLayout;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
 * @Author:cxs
 * @Date:2021/10/21  14:23
 * @Version 1.0
 * @Motto:放下杂念,只为迎接明天更好的自己
 * */
@Service
public class PharmacyServiceImpl implements PharmacyService {
    @Autowired
    private PharmacyMapper pharmacyMapper;

    @Override
    public PageInfo<Pharmacy> selDrug(String keyword, Integer pageno, Integer PageSize) {
        PageHelper.startPage(pageno, PageSize);
        List<Pharmacy> pharmacyList = pharmacyMapper.selectDrugByName(keyword);
        return new PageInfo<>(pharmacyList);
    }
}
